package com.hushao.aimi.controller;

import com.hushao.aimi.common.ResponseCode;
import com.hushao.aimi.common.ServerResponse;
import com.hushao.aimi.service.ProductService;
import com.hushao.aimi.service.RecommendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 首页控制器
 * @author: 胡少
 * @create: 2018-06-08 11:14
 **/
@RestController
@Slf4j
@RequestMapping("/home")
@Api(value = "首页服务")
public class MainController {

    @Autowired
    private RecommendService recommendService;

    @GetMapping("/noLogin")
    @ApiOperation(value = "没有登录")
    public ServerResponse needLogin(){
        return ServerResponse.Error(ResponseCode.UNAUTHORIZED.getCode(),"没有登录");
    }

    @ApiOperation("轮播图")
    @GetMapping("/banners")
    private ServerResponse main(){
       return recommendService.beanner();
    }

    @ApiOperation("其他")
    @GetMapping("/other")
    private ServerResponse other(){
        return recommendService.other();
    }



}
